// pages/admin/pages/orderDetail/orderDetail.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsList: [], //商品列表
    order:null,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let order = JSON.parse(options.order);
      this.setData({
        order:order,
      })
   this.queryGoods();
  },
  queryGoods(){
    let _this = this;
    var header = app.globalData.header; //获取app.js中的请求头
    wx.request({
      url: app.globalData.ipPort +'/front/order/query/goods/'+_this.data.order.id,
      method: 'get',
      header: header,
      success(res) {
        if (res.data.code == 200) {
          var data = res.data.data
          _this.setData({
            goodsList: res.data.data
          })
        } else {
          wx.showToast({
            title: res.data.msg,
            icon: "none"
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.msg,
          icon: "none"
        })
      }
    })
  }

  
})